package drg_group.zhejiang_2022.ADRG;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

import drg_group.zhejiang_2022.Base;
import drg_group.zhejiang_2022.MedicalRecord;
import drg_group.zhejiang_2022.DRG.MDCN_DRG;

public class NA2 {
    public static String group(MedicalRecord record){
        String[] adrg_zd={};
        String[] adrg_zd1={};
        String[] adrg_ss={"38.8609","38.8700x002","38.8700x008","38.8700x009","38.8702","39.7900x019","39.7900x023","54.0x01","54.2100x005","54.4x00x039","65.0100x002","65.0100x003","65.0101","65.0103","65.0900x003","65.0900x005","65.0901","65.1200x001","65.1300","65.1400","65.2200","65.2400","65.2500x003","65.2500x011","65.2501","65.2502","65.2503","65.2504","65.2505","65.2900x001","65.2901","65.2902","65.2903","65.2904","65.2905","65.2906","65.3100","65.3900x001","65.3900x002","65.4100","65.4900x001","65.4901","65.5100","65.5100x001","65.5100x003","65.5200","65.5200x001","65.5300","65.5400","65.6100","65.6101","65.6200x001","65.6300","65.6301","65.6400","65.7100x001","65.7200x001","65.7300x001","65.7400","65.7500","65.7600","65.7900x008","65.7900x009","65.7900x010","65.7901","65.7902","65.7903","65.7904","65.7905","65.8101","65.8102","65.8900x001","65.8901","65.8902","65.9200","65.9400","65.9500","65.9901","65.9902","66.0100x003","66.0100x005","66.0100x008","66.0101","66.0102","66.1101","66.1900x001","66.2101","66.2200x001","66.2900x001","66.2900x003","66.3200x001","66.4x00","66.4x01","66.4x02","66.5100","66.5101","66.5102","66.5200","66.5201","66.6100x001","66.6100x002","66.6100x003","66.6100x006","66.6100x007","66.6100x008","66.6100x011","66.6100x012","66.6101","66.6102","66.6103","66.6104","66.6300","66.6301","66.6901","66.6902","66.7100","66.7100x002","66.7200","66.7300","66.7301","66.7400","66.7401","66.7900x009","66.7901","66.7902","66.7905","66.7906","66.9100x003","66.9201","66.9204","66.9205","66.9301","66.9302","66.9400","66.9500x001","66.9500x004","66.9501","66.9502","66.9600","66.9600x002","66.9700","67.0x00x002","67.0x01","67.2x00","67.2x01","67.3200","67.3200x009","67.3200x012","67.3201","67.3202","67.3203","67.3300","67.3301","67.3302","67.3901","67.3902","67.3903","67.3904","67.3905","67.4x00x005","67.4x00x006","67.4x01","67.4x02","67.4x03","67.4x04","67.4x05","67.4x06","67.4x07","67.4x08","67.6901","68.0x00x004","68.0x00x006","68.0x00x007","68.0x01","68.2100x002","68.2101","68.2201","68.2202","68.2203","68.2204","68.2205","68.2206","68.2300","68.2300x005","68.2301","68.2302","68.2400","68.2401","68.2500x001","68.2501","68.2900x035","68.2900x037","68.2900x038","68.2900x048","68.2901","68.2902","68.2903","68.2904","68.2905","68.2906","68.2907","68.2908","68.2909","68.2910","68.2911","68.2912","68.2913","68.2914","68.2915","68.2916","68.2917","68.2918","68.3100x002","68.3101","68.3102","68.3103","68.3104","68.3105","68.3106","68.3900x003","68.3901","68.3902","68.3903","68.3904","68.3905","68.3906","68.3907","68.4100","68.4102","68.4103","68.4104","68.4900x004","68.4901","68.4902","68.4905","68.5100x004","68.5100x005","68.5102","68.5103","68.5900x002","68.5901","68.5902","68.9x00","69.1900x022","69.1901","69.1902","69.1903","69.1904","69.1905","69.1907","69.1908","69.1909","69.2201","69.3x01","69.3x02","69.4200","69.4201","69.4900x005","69.4900x006","69.4903","69.9500","69.9500x001","69.9600","70.1300","70.1400x007","70.1402","70.1403","70.1404","70.1406","70.3100","70.3101","70.3200x002","70.3201","70.3300x003","70.3301","70.3302","70.3304","70.3305","70.4x00x001","70.4x01","70.4x02","70.4x05","70.7900x005","70.7900x006","70.7907","71.0100x002","71.0100x003","71.0100x004","71.0900x001","71.0901","71.0902","71.0904","71.2300x001","71.2400x001","71.2400x003","71.2401","71.2900x001","71.3x00x001","71.3x00x007","71.3x00x011","71.3x00x013","71.3x00x025","71.3x01","71.3x03","71.3x04","71.3x05","71.4x01","71.4x02","71.4x03","71.4x04","71.6100","71.6200","71.6200x002","71.7900x012"};
        String[] adrg_ss1={};
        
        if (true && record.ssList!=null && record.ssList.length>0 && Base.intersect(record.ssList,adrg_ss)){
            Base.groupMessages.putMessage(record.Index,"符合NA2入组条件，匹配规则：某一手术匹配");
                
            if (MDCN_DRG.NA21_group(record)){
                return "NA21";
            }
    
            if (MDCN_DRG.NA23_group(record)){
                return "NA23";
            }
    
            if (MDCN_DRG.NA25_group(record)){
                return "NA25";
            }

            return "NA2";
        }else{
            return "";
        }
    }
}

